<template>
  <div>
    <Header />
    <router-view />
    <Footer v-if="footerIsShow" />
  </div>
</template>

<script>
import Header from "@/components/Header";
import Footer from "@/components/Footer";
export default {
  name: "App",
  data() {
    return {
      blackRoute: ["Login", "Register"],
    };
  },
  components: {
    Header,
    Footer,
  },
  computed: {
    footerIsShow() {
      // 方法1：计算属性
      // return this.$route.name !== "Login" && this.$route.name !== "Register";
      // 方法二：路由黑名单
      // return !this.blackRoute.includes(this.$route.name);

      // 方法三：路由元信息
      return !this.$route.meta.footerIsHidden;
    },
  },
};
</script>

<style lang="less" scoped></style>
